<?php

/****************************************************************************************\
 **   @name		EXP Templates 1.0                                               **
 **   @package          Joomla 1.6/1.7/2.5                                              **
 **   @author		EXP TEAM::Alexey Kurguz (Grusha)                                **
 **   @copyright	Copyright (C) 2005 - 2011  EXP TEAM::Alexey Kurguz (Grusha)     **
 **   @link             http://www.feellove.eu                                          **
 **   @license		Commercial License                                              **
 \****************************************************************************************/
// no direct access
defined('_JEXEC') or die('Restricted access');

function pagination_list_footer($list) {
    $html = "<div class=\"list-footer\">\n";

    $html .= "\n<div class=\"limit\">" . JText::_('Display Num') . $list['limitfield'] . "</div>";
    $html .= $list['pageslinks'];
    $html .= "\n<div class=\"counter\">" . $list['pagescounter'] . "</div>";

    $html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"" . $list['limitstart'] . "\" />";
    $html .= "\n</div>";

    return $html;
}

function pagination_list_render($list) {
    //print_r($list);
    // Initialize variables
    $html = "<ul>";
    $btnclass = '';
    if (!$list['start']['active'] || !$list['previous']['active']) {
        $btnclass = ' class="active"';
    }
    $html .= '<li' . $btnclass . '>' . $list['start']['data'] . '</li>';
    $html .= '<li' . $btnclass . '>' . $list['previous']['data'] . '</li>';
    foreach ($list['pages'] as $page) {
        //print_r($page['active']);
        $class = '';
        if (!$page['active']) {
            $class = ' class="active"';
        }
        $html .= '<li' . $class . '>' . $page['data'] . '</li>';
    }
    $btnbclass = '';
    if (!$list['next']['active'] || !$list['end']['active']) {
        $btnbclass = ' class="active"';
    }
    $html .= '<li' . $btnbclass . '>' . $list['next']['data'] . '</li>';
    $html .= '<li' . $btnbclass . '>' . $list['end']['data'] . '</li>';
    //$html .= '<span>&raquo;</span>';

    $html .= "</ul>";
    return $html;
}

function pagination_item_active(&$item) {
    return "<a href=\"" . $item->link . "\" title=\"" . $item->text . "\">" . $item->text . "</a>";
}

function pagination_item_inactive(&$item) {
    return "<a href=\"#\">" . $item->text . "</a>";
}

?>